package esempio.domain;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "REQUEST")
public class Request {

	private long requestId;
	private Date dateRequest; 
	private Date appointment; 
	private int quantity;
	private float unitPrice;
	private float totalPrice;
	private Vehicle vehicle;
	
	
	public Request(Date dateRequest, Date appointment, int quantity,
			float unitPrice, float totalPrice, Vehicle vehicle) {
		
		this.dateRequest = dateRequest;
		this.appointment = appointment;
		this.quantity = quantity;
		this.unitPrice = unitPrice;
		this.totalPrice = totalPrice;
		this.vehicle = vehicle;
	}


	public Request() {
		
	}
	@Id
	@GeneratedValue
	@Column(name="REQUEST_ID")
	public long getRequestId() {
		return requestId;
	}

	public void setRequestId(long requestId) {
		this.requestId = requestId;
	}
	@Column(name="DATE_REQUEST")
	public Date getDateRequest() {
		return dateRequest;
	}

	public void setDateRequest(Date dateRequest) {
		this.dateRequest = dateRequest;
	}
	@Column(name="DATE_APPOINTTEMENT")
	public Date getAppointment() {
		return appointment;
	}

	public void setAppointment(Date appointment) {
		this.appointment = appointment;
	}
	@Column(name="QUANTITY")
	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	@Column(name="UNIT_PRICE")
	public float getUnitPrice() {
		return unitPrice;
	}

	public void setUnitPrice(float unitPrice) {
		this.unitPrice = unitPrice;
	}
	@Column(name="TOTAL_PRICE")
	public float getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(float totalPrice) {
		this.totalPrice = totalPrice;
	}

	@ManyToOne(cascade = CascadeType.ALL)
	public Vehicle getVehicle() {
		return vehicle;
	}


	public void setVehicle(Vehicle vehicle) {
		this.vehicle = vehicle;
	}
	
	
	
	
}
